﻿namespace LinkedTU.Models
{
    using LinkedTU.Common.Constants;
    using System;
    using System.Collections.Generic;
    using System.ComponentModel.DataAnnotations;
    using System.ComponentModel.DataAnnotations.Schema;

    public class Company : BaseDbEntity
    {
        private ICollection<Job> employees;

        public Company()
        {
            this.employees = new HashSet<Job>();
        }

        [Key]
        public int CompanyId { get; set; }

        [Required]
        [MinLength(ValidationConstants.MinCompanyNameLength)]
        [MaxLength(ValidationConstants.MaxCompanyNameLength)]
        public string Name { get; set; }

        [MaxLength(ValidationConstants.MaxCompanyDescriptionLength)]
        public string Description { get; set; }

        public string LogoPath { get; set; }

        public virtual Country Country { get; set; }

        public virtual City City { get; set; }

        public virtual CompanySize CompanySize { get; set; }

        public virtual ICollection<Job> Employees
        {
            get { return this.employees; }
            set { this.employees = value; }
        }
    }
}
